import re

def test():
  '''match从字符串开头位置匹配, search从字符串任意位置匹配'''
  string = 'scriptsrchttcdnbootcsscomjquery1102jquery'
  s = re.sub('jquery$', 'JQUERY', string)

  print(s)
  print(re.match('scr', string))

  m = re.search('(jquery)', string)

  # m = re.search('^<appWidth>admin:(\$P\$).*</appWidth>$', '<appWidth>admin:$P$BozVdXLRH92flzLRapyWARJrUse1jb1</appWidth>')

  print(m.group())
  print(m.groups())
  print(re.findall('jquery', string))

if __name__ == '__main__':
  # test()

  s = '<br><br>任務獎勵： 金錢 1:lovingcatz:464cffb1ca4981f9f2948467fa34ade6,3:cfc:daa64821e017263c385b044836dd87ed,4:bruce:fcf7c62587a5db773dc0f6437f4659b3,5:itszero:698c2f74e244b770043df3ca904a8a99,6:hitakeane:7688f83e7eb09ed2d80841c79636a59b,7:poga:9e01a77b39aff93aca27713f60707da0,8:weijenlu:e7111b16c0ade1c3e4700c105f8b7efe,9:chuyihuang:fb0d339aec2bf7985a5758e9c064a4 </td></tr><tr><td align="right">所在帖子TID<INPUT name="ans" maxlength="10"></td><td align=left>註：帖子地址中都有tid=xxxx，其中那串數字xxxx就是帖子的TID　<button class="submit" type="submit" name="submit">我找到了答案</button></td></tr></FORM><tr><td colspan=3 align=center>任務優勝者  <font color=red>5</font></td></tr>'
  m = re.search('(\d+\:\w+\:\w{32})+', s)
  print(m.group())
  print(re.findall('(\d+\:\w+\:\w{32})+', s))